package com.netease.pris.c;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import android.net.Uri;
import android.text.TextUtils;
import com.netease.g.b;
import com.netease.pris.atom.aa;
import com.netease.pris.atom.o;
import com.netease.pris.atom.r;
import com.netease.pris.atom.u;
import com.netease.pris.protocol.a;
import com.netease.pris.protocol.h;
import com.netease.pris.provider.m;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class c
{
  static final String a = "ManagerSubcribe";
  static String[] b;
  static String[] c;
  public static final int d = 0;
  public static final int e = 1;
  public static final int f = 2;
  public static final int g = 3;
  public static final int h = 4;
  public static final int i = 5;
  public static final int j = 6;
  public static final int k = 7;
  public static final int l = 8;
  public static final int m = 9;

  static
  {
    String[] arrayOfString1 = new String[10];
    arrayOfString1[0] = "_id";
    arrayOfString1[1] = "account";
    arrayOfString1[2] = "uid";
    arrayOfString1[3] = "updated";
    arrayOfString1[4] = "title";
    arrayOfString1[5] = "type";
    arrayOfString1[6] = "seq";
    arrayOfString1[7] = "other";
    arrayOfString1[8] = "content";
    arrayOfString1[9] = "refresh";
    b = arrayOfString1;
    String[] arrayOfString2 = new String[1];
    arrayOfString2[0] = "MAX(seq) AS max_seq";
    c = arrayOfString2;
  }

  public static int a(Context paramContext, String paramString)
  {
    Cursor localCursor;
    if (paramContext != null)
    {
      ContentResolver localContentResolver = paramContext.getContentResolver();
      Uri localUri = m.k;
      String[] arrayOfString1 = c;
      String[] arrayOfString2 = new String[1];
      arrayOfString2[0] = paramString;
      localCursor = localContentResolver.query(localUri, arrayOfString1, "account = ?", arrayOfString2, null);
      if (localCursor == null);
    }
    try
    {
      int i1;
      if (localCursor.moveToFirst())
        i1 = localCursor.getInt(0);
      for (int n = i1; ; n = 0)
      {
        return n;
        if (localCursor == null)
          continue;
        localCursor.close();
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        if (localCursor == null)
          continue;
        localCursor.close();
      }
    }
    finally
    {
      if (localCursor != null)
        localCursor.close();
    }
    throw localObject;
  }

  public static LinkedList a(Context paramContext, String paramString, boolean paramBoolean)
  {
    Object localObject1 = null;
    String str1 = " (account = '" + paramString + "'" + " ) OR " + "type" + " = " + m.o;
    Cursor localCursor = paramContext.getContentResolver().query(m.k, b, str1, null, " seq ASC");
    if (localCursor == null)
      return localObject1;
    while (true)
    {
      try
      {
        if (!localCursor.moveToFirst())
          continue;
        LinkedList localLinkedList = new LinkedList();
        n = 0;
        String str2 = localCursor.getString(8);
        int i1 = localCursor.getInt(6);
        long l1 = localCursor.getLong(9);
        if (str2 != null)
          continue;
        i2 = n;
        boolean bool = localCursor.moveToNext();
        if (!bool)
        {
          if (localCursor == null)
            continue;
          localCursor.close();
          localObject1 = localLinkedList;
          break;
          if (!paramBoolean)
            continue;
          a(localLinkedList, str2, i1, l1);
          if (localLinkedList.size() <= 0)
            break label342;
          ((u)localLinkedList.getLast()).c();
          break label342;
          u localu = new u();
          localu.b(i1);
          localu.b(l1);
          localu.d(false);
          localu.q(localCursor.getString(2));
          localu.a("title", localCursor.getString(4));
          if (localu.V() == null)
            break label342;
          localLinkedList.add(localu);
        }
      }
      catch (Exception localException)
      {
        if (localCursor == null)
          break;
        localCursor.close();
        break;
        if (localCursor == null)
          break;
        localCursor.close();
        break;
      }
      finally
      {
        if (localCursor == null)
          continue;
        localCursor.close();
      }
      int n = i2;
      continue;
      label342: int i2 = n + 1;
    }
  }

  public static void a(Context paramContext, u paramu)
  {
    if ((paramContext == null) || (paramu == null));
    while (true)
    {
      return;
      if (!TextUtils.isEmpty(paramu.V()))
      {
        long l1 = System.currentTimeMillis();
        ContentValues localContentValues = new ContentValues();
        localContentValues.put("refresh", Long.valueOf(l1));
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = m.k;
        String[] arrayOfString = new String[1];
        arrayOfString[0] = paramu.V();
        localContentResolver.update(localUri, localContentValues, "uid= ?", arrayOfString);
        paramu.b(l1);
        continue;
      }
    }
  }

  public static void a(Context paramContext, String paramString, u paramu)
  {
    if ((paramContext == null) || (TextUtils.isEmpty(paramString)) || (paramu == null));
    while (true)
    {
      return;
      long l1 = System.currentTimeMillis();
      ContentValues localContentValues = new ContentValues();
      localContentValues.put("account", paramString);
      localContentValues.put("uid", paramu.V());
      localContentValues.put("updated", paramu.Y());
      localContentValues.put("title", paramu.U());
      localContentValues.put("type", Integer.valueOf(m.n));
      localContentValues.put("content", paramu.toString());
      paramu.b(1 + a(paramContext, paramString));
      localContentValues.put("seq", Integer.valueOf(paramu.h()));
      paramContext.getContentResolver().insert(m.k, localContentValues);
      localContentValues.clear();
      if (!com.netease.pris.app.e.e)
        continue;
      b.e("ManagerSubcribe", "addSubscribeItem  time is:" + (System.currentTimeMillis() - l1));
    }
  }

  public static void a(Context paramContext, String paramString1, String paramString2)
  {
    long l1 = System.currentTimeMillis();
    String str = "account = '" + paramString1 + "' AND " + "uid" + " = '" + paramString2 + "'" + "  AND  " + "type" + " = " + m.n;
    paramContext.getContentResolver().delete(m.k, str, null);
    if (com.netease.pris.app.e.e)
      b.e("ManagerSubcribe", "deleteSubscribeItem time is:" + (System.currentTimeMillis() - l1));
  }

  public static void a(Context paramContext, String paramString1, String paramString2, boolean paramBoolean)
  {
    n.a(paramContext, paramString1, paramString2, paramBoolean);
  }

  public static void a(Context paramContext, String paramString, ArrayList paramArrayList)
  {
    n.a(paramContext, paramArrayList, paramString);
  }

  public static void a(Context paramContext, String paramString, Collection paramCollection)
  {
    if ((paramCollection != null) && (paramCollection.size() > 0))
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("account").append(" = '").append(paramString).append("'").append("  AND ").append("type").append(" = ").append(m.n);
      localStringBuilder.append(" AND ").append("uid").append(" IN (");
      Iterator localIterator = paramCollection.iterator();
      while (localIterator.hasNext())
      {
        u localu = (u)localIterator.next();
        localStringBuilder.append("'").append(localu.V()).append("'").append(",");
      }
      localStringBuilder.deleteCharAt(-1 + localStringBuilder.length());
      localStringBuilder.append(')');
      paramContext.getContentResolver().delete(m.k, localStringBuilder.toString(), null);
    }
  }

  // ERROR //
  public static void a(Context paramContext, String paramString, LinkedList paramLinkedList)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_3
    //   2: aload_2
    //   3: ifnull +10 -> 13
    //   6: aload_2
    //   7: invokevirtual 152	java/util/LinkedList:size	()I
    //   10: ifgt +4 -> 14
    //   13: return
    //   14: invokestatic 197	java/lang/System:currentTimeMillis	()J
    //   17: lstore 4
    //   19: getstatic 254	com/netease/pris/app/e:e	Z
    //   22: ifeq +31 -> 53
    //   25: ldc 8
    //   27: new 106	java/lang/StringBuilder
    //   30: dup
    //   31: invokespecial 107	java/lang/StringBuilder:<init>	()V
    //   34: ldc_w 323
    //   37: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   40: aload_2
    //   41: invokevirtual 152	java/util/LinkedList:size	()I
    //   44: invokevirtual 125	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   47: invokevirtual 129	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   50: invokestatic 263	com/netease/g/b:e	(Ljava/lang/String;Ljava/lang/String;)V
    //   53: aload_0
    //   54: invokestatic 328	com/netease/pris/provider/ac:a	(Landroid/content/Context;)Lcom/netease/pris/provider/ac;
    //   57: invokevirtual 332	com/netease/pris/provider/ac:getWritableDatabase	()Landroid/database/sqlite/SQLiteDatabase;
    //   60: astore 6
    //   62: aload 6
    //   64: invokevirtual 337	android/database/sqlite/SQLiteDatabase:beginTransaction	()V
    //   67: new 106	java/lang/StringBuilder
    //   70: dup
    //   71: invokespecial 107	java/lang/StringBuilder:<init>	()V
    //   74: astore 7
    //   76: aload 7
    //   78: ldc_w 339
    //   81: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   84: pop
    //   85: aload 7
    //   87: ldc_w 341
    //   90: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   93: pop
    //   94: aload 7
    //   96: ldc_w 343
    //   99: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   102: pop
    //   103: aload 7
    //   105: ldc 40
    //   107: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   110: pop
    //   111: aload 7
    //   113: ldc_w 311
    //   116: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   119: pop
    //   120: aload 7
    //   122: ldc 42
    //   124: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   127: pop
    //   128: aload 7
    //   130: ldc_w 311
    //   133: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   136: pop
    //   137: aload 7
    //   139: ldc 44
    //   141: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   144: pop
    //   145: aload 7
    //   147: ldc_w 311
    //   150: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   153: pop
    //   154: aload 7
    //   156: ldc 46
    //   158: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   161: pop
    //   162: aload 7
    //   164: ldc_w 311
    //   167: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   170: pop
    //   171: aload 7
    //   173: ldc 54
    //   175: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   178: pop
    //   179: aload 7
    //   181: ldc_w 311
    //   184: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   187: pop
    //   188: aload 7
    //   190: ldc 48
    //   192: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   195: pop
    //   196: aload 7
    //   198: ldc_w 311
    //   201: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   204: pop
    //   205: aload 7
    //   207: ldc 50
    //   209: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   212: pop
    //   213: aload 7
    //   215: ldc_w 311
    //   218: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   221: pop
    //   222: aload 7
    //   224: ldc 56
    //   226: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   229: pop
    //   230: aload 7
    //   232: ldc_w 345
    //   235: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   238: pop
    //   239: aload 7
    //   241: ldc_w 347
    //   244: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   247: pop
    //   248: aload 7
    //   250: ldc_w 349
    //   253: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   256: pop
    //   257: aload 7
    //   259: ldc_w 351
    //   262: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   265: pop
    //   266: aload 6
    //   268: aload 7
    //   270: invokevirtual 129	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   273: invokevirtual 355	android/database/sqlite/SQLiteDatabase:compileStatement	(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;
    //   276: astore 33
    //   278: aload 33
    //   280: astore 9
    //   282: aload 7
    //   284: iconst_0
    //   285: invokevirtual 358	java/lang/StringBuilder:setLength	(I)V
    //   288: aload 7
    //   290: ldc_w 360
    //   293: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   296: pop
    //   297: aload 7
    //   299: ldc_w 341
    //   302: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   305: pop
    //   306: aload 7
    //   308: ldc_w 362
    //   311: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   314: pop
    //   315: aload 7
    //   317: ldc 50
    //   319: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   322: pop
    //   323: aload 7
    //   325: ldc_w 364
    //   328: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   331: pop
    //   332: aload 7
    //   334: ldc_w 366
    //   337: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   340: pop
    //   341: aload 7
    //   343: ldc 40
    //   345: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   348: pop
    //   349: aload 7
    //   351: ldc_w 364
    //   354: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   357: pop
    //   358: aload 7
    //   360: ldc_w 295
    //   363: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   366: pop
    //   367: aload 7
    //   369: ldc 42
    //   371: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   374: pop
    //   375: aload 7
    //   377: ldc_w 364
    //   380: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   383: pop
    //   384: aload 6
    //   386: aload 7
    //   388: invokevirtual 129	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   391: invokevirtual 355	android/database/sqlite/SQLiteDatabase:compileStatement	(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;
    //   394: astore_3
    //   395: aload_2
    //   396: invokevirtual 367	java/util/LinkedList:iterator	()Ljava/util/Iterator;
    //   399: astore 45
    //   401: aload 45
    //   403: invokeinterface 306 1 0
    //   408: ifeq +159 -> 567
    //   411: aload 45
    //   413: invokeinterface 309 1 0
    //   418: checkcast 158	com/netease/pris/atom/u
    //   421: astore 46
    //   423: ldc_w 369
    //   426: aload 46
    //   428: invokevirtual 180	com/netease/pris/atom/u:V	()Ljava/lang/String;
    //   431: invokevirtual 372	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   434: ifne -33 -> 401
    //   437: aload 46
    //   439: invokevirtual 375	com/netease/pris/atom/u:w	()Z
    //   442: ifne +85 -> 527
    //   445: aload 6
    //   447: aload 46
    //   449: aload_1
    //   450: aload 9
    //   452: invokestatic 378	com/netease/pris/c/c:b	(Landroid/database/sqlite/SQLiteDatabase;Lcom/netease/pris/atom/u;Ljava/lang/String;Landroid/database/sqlite/SQLiteStatement;)V
    //   455: goto -54 -> 401
    //   458: astore 8
    //   460: aload 8
    //   462: invokevirtual 103	java/lang/Exception:printStackTrace	()V
    //   465: aload_3
    //   466: ifnull +7 -> 473
    //   469: aload_3
    //   470: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   473: aload 9
    //   475: ifnull +8 -> 483
    //   478: aload 9
    //   480: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   483: aload 6
    //   485: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   488: getstatic 254	com/netease/pris/app/e:e	Z
    //   491: ifeq -478 -> 13
    //   494: ldc 8
    //   496: new 106	java/lang/StringBuilder
    //   499: dup
    //   500: invokespecial 107	java/lang/StringBuilder:<init>	()V
    //   503: ldc_w 386
    //   506: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   509: invokestatic 197	java/lang/System:currentTimeMillis	()J
    //   512: lload 4
    //   514: lsub
    //   515: invokevirtual 259	java/lang/StringBuilder:append	(J)Ljava/lang/StringBuilder;
    //   518: invokevirtual 129	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   521: invokestatic 263	com/netease/g/b:e	(Ljava/lang/String;Ljava/lang/String;)V
    //   524: goto -511 -> 13
    //   527: aload 6
    //   529: aload 46
    //   531: aload_1
    //   532: aload_3
    //   533: invokestatic 388	com/netease/pris/c/c:a	(Landroid/database/sqlite/SQLiteDatabase;Lcom/netease/pris/atom/u;Ljava/lang/String;Landroid/database/sqlite/SQLiteStatement;)V
    //   536: goto -135 -> 401
    //   539: astore 10
    //   541: aload_3
    //   542: ifnull +7 -> 549
    //   545: aload_3
    //   546: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   549: aload 9
    //   551: ifnull +8 -> 559
    //   554: aload 9
    //   556: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   559: aload 6
    //   561: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   564: aload 10
    //   566: athrow
    //   567: aload 6
    //   569: invokevirtual 391	android/database/sqlite/SQLiteDatabase:setTransactionSuccessful	()V
    //   572: aload_3
    //   573: ifnull +7 -> 580
    //   576: aload_3
    //   577: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   580: aload 9
    //   582: ifnull +8 -> 590
    //   585: aload 9
    //   587: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   590: aload 6
    //   592: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   595: goto -107 -> 488
    //   598: astore 10
    //   600: aconst_null
    //   601: astore 9
    //   603: goto -62 -> 541
    //   606: astore 8
    //   608: aconst_null
    //   609: astore 9
    //   611: goto -151 -> 460
    //
    // Exception table:
    //   from	to	target	type
    //   282	455	458	java/lang/Exception
    //   527	536	458	java/lang/Exception
    //   567	572	458	java/lang/Exception
    //   282	455	539	finally
    //   460	465	539	finally
    //   527	536	539	finally
    //   567	572	539	finally
    //   67	278	598	finally
    //   67	278	606	java/lang/Exception
  }

  // ERROR //
  public static void a(Context paramContext, HashMap paramHashMap, String paramString)
  {
    // Byte code:
    //   0: aload_0
    //   1: ifnull +21 -> 22
    //   4: aload_1
    //   5: ifnull +17 -> 22
    //   8: aload_1
    //   9: invokevirtual 395	java/util/HashMap:size	()I
    //   12: ifeq +10 -> 22
    //   15: aload_2
    //   16: invokestatic 191	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   19: ifeq +4 -> 23
    //   22: return
    //   23: aload_0
    //   24: invokestatic 328	com/netease/pris/provider/ac:a	(Landroid/content/Context;)Lcom/netease/pris/provider/ac;
    //   27: invokevirtual 332	com/netease/pris/provider/ac:getWritableDatabase	()Landroid/database/sqlite/SQLiteDatabase;
    //   30: astore_3
    //   31: aload_3
    //   32: invokevirtual 337	android/database/sqlite/SQLiteDatabase:beginTransaction	()V
    //   35: aconst_null
    //   36: astore 4
    //   38: new 106	java/lang/StringBuilder
    //   41: dup
    //   42: invokespecial 107	java/lang/StringBuilder:<init>	()V
    //   45: astore 5
    //   47: aload 5
    //   49: ldc_w 360
    //   52: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   55: pop
    //   56: aload 5
    //   58: ldc_w 341
    //   61: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   64: pop
    //   65: aload 5
    //   67: ldc_w 362
    //   70: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   73: pop
    //   74: aload 5
    //   76: ldc 50
    //   78: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   81: pop
    //   82: aload 5
    //   84: ldc_w 397
    //   87: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   90: pop
    //   91: aload 5
    //   93: ldc 40
    //   95: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   98: pop
    //   99: aload 5
    //   101: ldc_w 399
    //   104: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   107: pop
    //   108: aload 5
    //   110: ldc 42
    //   112: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   115: pop
    //   116: aload 5
    //   118: ldc_w 401
    //   121: invokevirtual 113	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   124: pop
    //   125: aload_3
    //   126: aload 5
    //   128: invokevirtual 129	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   131: invokevirtual 355	android/database/sqlite/SQLiteDatabase:compileStatement	(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;
    //   134: astore 17
    //   136: aload_1
    //   137: invokevirtual 405	java/util/HashMap:entrySet	()Ljava/util/Set;
    //   140: invokeinterface 408 1 0
    //   145: astore 18
    //   147: aload 18
    //   149: invokeinterface 306 1 0
    //   154: ifeq +94 -> 248
    //   157: aload 18
    //   159: invokeinterface 309 1 0
    //   164: checkcast 410	java/util/Map$Entry
    //   167: astore 19
    //   169: aload 17
    //   171: iconst_1
    //   172: aload 19
    //   174: invokeinterface 413 1 0
    //   179: checkcast 231	java/lang/Integer
    //   182: invokevirtual 416	java/lang/Integer:intValue	()I
    //   185: i2l
    //   186: invokevirtual 420	android/database/sqlite/SQLiteStatement:bindLong	(IJ)V
    //   189: aload 17
    //   191: iconst_2
    //   192: aload_2
    //   193: invokevirtual 424	android/database/sqlite/SQLiteStatement:bindString	(ILjava/lang/String;)V
    //   196: aload 17
    //   198: iconst_3
    //   199: aload 19
    //   201: invokeinterface 427 1 0
    //   206: checkcast 36	java/lang/String
    //   209: invokevirtual 424	android/database/sqlite/SQLiteStatement:bindString	(ILjava/lang/String;)V
    //   212: aload 17
    //   214: invokevirtual 430	android/database/sqlite/SQLiteStatement:execute	()V
    //   217: goto -70 -> 147
    //   220: astore 6
    //   222: aload 17
    //   224: astore 4
    //   226: aload 6
    //   228: invokevirtual 103	java/lang/Exception:printStackTrace	()V
    //   231: aload 4
    //   233: ifnull +8 -> 241
    //   236: aload 4
    //   238: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   241: aload_3
    //   242: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   245: goto -223 -> 22
    //   248: aload_3
    //   249: invokevirtual 391	android/database/sqlite/SQLiteDatabase:setTransactionSuccessful	()V
    //   252: aload 17
    //   254: ifnull +8 -> 262
    //   257: aload 17
    //   259: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   262: aload_3
    //   263: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   266: goto -244 -> 22
    //   269: astore 7
    //   271: aload 4
    //   273: ifnull +8 -> 281
    //   276: aload 4
    //   278: invokevirtual 381	android/database/sqlite/SQLiteStatement:close	()V
    //   281: aload_3
    //   282: invokevirtual 384	android/database/sqlite/SQLiteDatabase:endTransaction	()V
    //   285: aload 7
    //   287: athrow
    //   288: astore 7
    //   290: aload 17
    //   292: astore 4
    //   294: goto -23 -> 271
    //   297: astore 6
    //   299: goto -73 -> 226
    //
    // Exception table:
    //   from	to	target	type
    //   136	217	220	java/lang/Exception
    //   248	252	220	java/lang/Exception
    //   38	136	269	finally
    //   226	231	269	finally
    //   136	217	288	finally
    //   248	252	288	finally
    //   38	136	297	java/lang/Exception
  }

  private static void a(SQLiteDatabase paramSQLiteDatabase, u paramu, String paramString, SQLiteStatement paramSQLiteStatement)
  {
    if ((paramSQLiteDatabase == null) || (paramu == null))
      return;
    while (true)
    {
      try
      {
        paramSQLiteStatement.bindLong(1, paramu.h());
        if (paramString != null)
        {
          paramSQLiteStatement.bindString(2, paramString);
          if (paramu.V() == null)
            break label75;
          paramSQLiteStatement.bindString(3, paramu.V());
          paramSQLiteStatement.execute();
          break;
        }
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
        break;
      }
      finally
      {
      }
      paramSQLiteStatement.bindNull(2);
      continue;
      label75: paramSQLiteStatement.bindNull(3);
    }
  }

  public static void a(com.netease.pris.protocol.d paramd)
  {
    if ((paramd != null) && (paramd.h != null))
    {
      Iterator localIterator = paramd.h.iterator();
      while (localIterator.hasNext())
        ((u)localIterator.next()).a(aa.a);
    }
  }

  public static void a(com.netease.pris.protocol.d paramd, String paramString)
  {
    if (paramd.h.size() == 0);
    while (true)
    {
      return;
      LinkedList localLinkedList = paramd.h;
      HashMap localHashMap = new HashMap();
      StringBuilder localStringBuilder = new StringBuilder();
      Iterator localIterator1 = localLinkedList.iterator();
      while (localIterator1.hasNext())
      {
        u localu2 = (u)localIterator1.next();
        if ((localu2 == null) || (!localu2.al()))
          continue;
        localHashMap.put(localu2.V(), localu2);
        localStringBuilder.append("'").append(localu2.V()).append("'").append(",");
      }
      if (localHashMap.size() == 0)
        continue;
      if (localStringBuilder.length() > 0)
        localStringBuilder.deleteCharAt(-1 + localStringBuilder.length());
      Cursor localCursor = b(com.netease.b.a.d.h().a(), paramString, localStringBuilder.toString());
      if (localCursor == null)
        continue;
      if (localCursor.moveToFirst())
        do
        {
          u localu1 = (u)localHashMap.remove(localCursor.getString(2));
          if (localu1 == null)
            continue;
          localu1.a(aa.a);
        }
        while (localCursor.moveToNext());
      Iterator localIterator2 = localHashMap.values().iterator();
      while (localIterator2.hasNext())
        ((u)localIterator2.next()).a(aa.b);
      if (localCursor == null)
        continue;
      localCursor.close();
    }
  }

  private static void a(LinkedList paramLinkedList, String paramString, int paramInt, long paramLong)
  {
    try
    {
      new h(new a(new j(paramInt, paramLong, paramLinkedList))).a(com.netease.pris.a.e.a(paramString));
      return;
    }
    catch (Exception localException)
    {
      while (true)
        localException.printStackTrace();
    }
  }

  public static Cursor b(Context paramContext, String paramString1, String paramString2)
  {
    Cursor localCursor = null;
    if ((paramContext == null) || (TextUtils.isEmpty(paramString1)) || (paramString2 == null));
    while (true)
    {
      return localCursor;
      String str = "account = '" + paramString1 + "' AND " + "uid" + " in " + "(" + paramString2 + ")";
      localCursor = paramContext.getContentResolver().query(m.k, b, str, null, null);
    }
  }

  // ERROR //
  public static u b(Context paramContext, String paramString, u paramu)
  {
    // Byte code:
    //   0: aload_2
    //   1: ifnull +17 -> 18
    //   4: aload_2
    //   5: invokevirtual 375	com/netease/pris/atom/u:w	()Z
    //   8: ifeq +10 -> 18
    //   11: aload_2
    //   12: invokevirtual 180	com/netease/pris/atom/u:V	()Ljava/lang/String;
    //   15: ifnonnull +7 -> 22
    //   18: aload_2
    //   19: astore_3
    //   20: aload_3
    //   21: areturn
    //   22: aload_0
    //   23: invokevirtual 74	android/content/Context:getContentResolver	()Landroid/content/ContentResolver;
    //   26: astore 4
    //   28: getstatic 79	com/netease/pris/provider/m:k	Landroid/net/Uri;
    //   31: astore 5
    //   33: getstatic 58	com/netease/pris/c/c:b	[Ljava/lang/String;
    //   36: astore 6
    //   38: iconst_2
    //   39: anewarray 36	java/lang/String
    //   42: astore 7
    //   44: aload 7
    //   46: iconst_0
    //   47: aload_1
    //   48: aastore
    //   49: aload 7
    //   51: iconst_1
    //   52: aload_2
    //   53: invokevirtual 180	com/netease/pris/atom/u:V	()Ljava/lang/String;
    //   56: aastore
    //   57: aload 4
    //   59: aload 5
    //   61: aload 6
    //   63: ldc_w 504
    //   66: aload 7
    //   68: ldc 131
    //   70: invokevirtual 87	android/content/ContentResolver:query	(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    //   73: astore 8
    //   75: aload 8
    //   77: ifnonnull +8 -> 85
    //   80: aconst_null
    //   81: astore_3
    //   82: goto -62 -> 20
    //   85: aload 8
    //   87: invokeinterface 93 1 0
    //   92: ifeq +76 -> 168
    //   95: new 133	java/util/LinkedList
    //   98: dup
    //   99: invokespecial 134	java/util/LinkedList:<init>	()V
    //   102: astore 11
    //   104: aload 11
    //   106: aload 8
    //   108: bipush 8
    //   110: invokeinterface 138 2 0
    //   115: aload 8
    //   117: bipush 6
    //   119: invokeinterface 97 2 0
    //   124: aload 8
    //   126: bipush 9
    //   128: invokeinterface 142 2 0
    //   133: invokestatic 148	com/netease/pris/c/c:a	(Ljava/util/LinkedList;Ljava/lang/String;IJ)V
    //   136: aload 11
    //   138: invokevirtual 152	java/util/LinkedList:size	()I
    //   141: ifle +27 -> 168
    //   144: aload 11
    //   146: invokevirtual 507	java/util/LinkedList:getFirst	()Ljava/lang/Object;
    //   149: checkcast 158	com/netease/pris/atom/u
    //   152: astore_3
    //   153: aload 8
    //   155: ifnull -135 -> 20
    //   158: aload 8
    //   160: invokeinterface 100 1 0
    //   165: goto -145 -> 20
    //   168: aload 8
    //   170: ifnull +10 -> 180
    //   173: aload 8
    //   175: invokeinterface 100 1 0
    //   180: aconst_null
    //   181: astore_3
    //   182: goto -162 -> 20
    //   185: astore 10
    //   187: aload 8
    //   189: ifnull -9 -> 180
    //   192: aload 8
    //   194: invokeinterface 100 1 0
    //   199: goto -19 -> 180
    //   202: astore 9
    //   204: aload 8
    //   206: ifnull +10 -> 216
    //   209: aload 8
    //   211: invokeinterface 100 1 0
    //   216: aload 9
    //   218: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   85	153	185	java/lang/Exception
    //   85	153	202	finally
  }

  public static List b(Context paramContext, String paramString)
  {
    Object localObject1 = null;
    ContentResolver localContentResolver = paramContext.getContentResolver();
    Uri localUri = m.k;
    String[] arrayOfString1 = new String[1];
    arrayOfString1[0] = "uid";
    String[] arrayOfString2 = new String[1];
    arrayOfString2[0] = paramString;
    Cursor localCursor = localContentResolver.query(localUri, arrayOfString1, "account= ?", arrayOfString2, null);
    if (localCursor != null);
    try
    {
      if (localCursor.moveToFirst())
      {
        LinkedList localLinkedList = new LinkedList();
        boolean bool;
        do
        {
          String str = localCursor.getString(0);
          if ((str != null) && (!localLinkedList.contains(str)))
            localLinkedList.add(str);
          bool = localCursor.moveToNext();
        }
        while (bool);
        if (localCursor != null)
          localCursor.close();
        localObject1 = localLinkedList;
      }
      while (true)
      {
        return localObject1;
        if (localCursor == null)
          continue;
        localCursor.close();
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        if (localCursor == null)
          continue;
        localCursor.close();
      }
    }
    finally
    {
      if (localCursor != null)
        localCursor.close();
    }
    throw localObject2;
  }

  public static void b(Context paramContext, String paramString, LinkedList paramLinkedList)
  {
    if ((paramLinkedList == null) || (paramLinkedList.size() <= 0));
    while (true)
    {
      return;
      int n = paramLinkedList.size();
      long l1 = System.currentTimeMillis();
      if (com.netease.pris.app.e.e)
        b.e("ManagerSubcribe", "deleteSubscribeByEntry size is:" + n);
      StringBuilder localStringBuilder = new StringBuilder();
      for (int i1 = 0; i1 < n; i1++)
      {
        u localu = (u)paramLinkedList.get(i1);
        if (localu == null)
          continue;
        localStringBuilder.append("'");
        localStringBuilder.append(localu.V());
        localStringBuilder.append("'");
        localStringBuilder.append(",");
      }
      if (localStringBuilder.length() > 0)
        localStringBuilder.deleteCharAt(-1 + localStringBuilder.length());
      String str = "account  = '" + paramString + "'" + " AND " + "uid" + " in " + " (" + localStringBuilder.toString() + " )";
      paramContext.getContentResolver().delete(m.k, str, null);
      if (!com.netease.pris.app.e.e)
        continue;
      b.e("ManagerSubcribe", "deleteSubscribeByEntry time is:" + (System.currentTimeMillis() - l1));
    }
  }

  private static void b(SQLiteDatabase paramSQLiteDatabase, u paramu, String paramString, SQLiteStatement paramSQLiteStatement)
  {
    if ((paramSQLiteDatabase == null) || (paramu == null))
      return;
    long l1 = System.currentTimeMillis();
    if (paramString != null);
    while (true)
    {
      try
      {
        paramSQLiteStatement.bindString(1, paramString);
        if (paramu.V() != null)
        {
          paramSQLiteStatement.bindString(2, paramu.V());
          if (paramu.Y() == null)
            break label227;
          paramSQLiteStatement.bindString(3, paramu.Y());
          if (paramu.U() == null)
            break label235;
          paramSQLiteStatement.bindString(4, paramu.U());
          long l2 = System.currentTimeMillis();
          paramSQLiteStatement.bindString(5, paramu.toString());
          if (!com.netease.pris.app.e.e)
            continue;
          b.e("ManagerSubcribe", "addSubscribe2DB write content time is:" + (System.currentTimeMillis() - l2));
          paramSQLiteStatement.bindLong(6, m.n);
          paramSQLiteStatement.bindLong(7, paramu.h());
          paramSQLiteStatement.bindLong(8, paramu.bk());
          paramSQLiteStatement.execute();
          if (!com.netease.pris.app.e.e)
            break;
          b.e("ManagerSubcribe", "addSubscribe2DB time is:" + (System.currentTimeMillis() - l1));
          break;
          paramSQLiteStatement.bindNull(1);
          continue;
        }
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
        continue;
      }
      finally
      {
      }
      paramSQLiteStatement.bindNull(2);
      continue;
      label227: paramSQLiteStatement.bindNull(3);
      continue;
      label235: paramSQLiteStatement.bindNull(4);
    }
  }

  public static void c(Context paramContext, String paramString, u paramu)
  {
    if (paramu == null);
    while (true)
    {
      return;
      long l1 = System.currentTimeMillis();
      a(paramContext, paramString, paramu);
      if (!com.netease.pris.app.e.e)
        continue;
      b.e("ManagerSubcribe", "updateSubscribe time is:" + (System.currentTimeMillis() - l1));
    }
  }

  public static void c(Context paramContext, String paramString, LinkedList paramLinkedList)
  {
    if ((paramLinkedList == null) || (paramLinkedList.size() <= 0));
    while (true)
    {
      return;
      int n = paramLinkedList.size();
      long l1 = System.currentTimeMillis();
      if (com.netease.pris.app.e.e)
        b.e("ManagerSubcribe", "deleteSubscribeByOk size is:" + n);
      StringBuilder localStringBuilder = new StringBuilder();
      for (int i1 = 0; i1 < n; i1++)
      {
        o localo = (o)paramLinkedList.get(i1);
        if (localo == null)
          continue;
        localStringBuilder.append("'");
        localStringBuilder.append(localo.a());
        localStringBuilder.append("'");
        localStringBuilder.append(",");
      }
      if (localStringBuilder.length() > 0)
        localStringBuilder.deleteCharAt(-1 + localStringBuilder.length());
      String str = "account  = '" + paramString + "'" + " AND " + "uid" + " in " + " (" + localStringBuilder.toString() + " )";
      paramContext.getContentResolver().delete(m.k, str, null);
      if (!com.netease.pris.app.e.e)
        continue;
      b.e("ManagerSubcribe", "deleteSubscribeByOk time is:" + (System.currentTimeMillis() - l1));
    }
  }

  public static boolean c(Context paramContext, String paramString)
  {
    String str = "account = '" + paramString + "'" + " AND " + "type" + " = " + m.n;
    Cursor localCursor = paramContext.getContentResolver().query(m.k, b, str, null, null);
    if ((localCursor == null) || (!localCursor.moveToFirst()))
      if (localCursor != null)
        localCursor.close();
    for (int n = 0; ; n = 1)
    {
      return n;
      localCursor.close();
    }
  }

  public static boolean c(Context paramContext, String paramString1, String paramString2)
  {
    return n.b(paramContext, paramString1, paramString2);
  }

  public static void d(Context paramContext, String paramString)
  {
    n.c(paramContext, paramString);
  }

  public static void d(Context paramContext, String paramString, LinkedList paramLinkedList)
  {
    if ((paramLinkedList == null) || (paramLinkedList.size() <= 0));
    while (true)
    {
      return;
      int n = paramLinkedList.size();
      long l1 = System.currentTimeMillis();
      if (com.netease.pris.app.e.e)
        b.e("ManagerSubcribe", "updateSubscribe size is:" + n);
      a(paramContext, paramString, paramLinkedList);
      if (!com.netease.pris.app.e.e)
        continue;
      b.e("ManagerSubcribe", "updateSubscribe time is:" + (System.currentTimeMillis() - l1));
    }
  }

  public static int e(Context paramContext, String paramString)
  {
    return n.b(paramContext, paramString);
  }

  public static void e(Context paramContext, String paramString, LinkedList paramLinkedList)
  {
    if ((paramLinkedList == null) || (paramLinkedList.size() <= 0));
    while (true)
    {
      return;
      int n = paramLinkedList.size();
      StringBuilder localStringBuilder = new StringBuilder();
      int i1 = 0;
      if (i1 < n)
      {
        r localr = (r)paramLinkedList.get(i1);
        if ((localr == null) || (localr.f() == 101));
        while (true)
        {
          i1++;
          break;
          if (localr.f() != 102)
            continue;
          localStringBuilder.append("'");
          localStringBuilder.append(localr.d());
          localStringBuilder.append("'");
          localStringBuilder.append(",");
        }
      }
      if (localStringBuilder.length() > 0)
        localStringBuilder.deleteCharAt(-1 + localStringBuilder.length());
      String str = "account  = '" + paramString + "'" + " AND " + "uid" + " in " + " (" + localStringBuilder.toString() + " )";
      paramContext.getContentResolver().delete(m.k, str, null);
    }
  }

  public static LinkedList f(Context paramContext, String paramString)
  {
    long l1 = System.currentTimeMillis();
    String str1 = "account  = '" + paramString + "' AND " + "subscribe" + "." + "uid" + " in (" + " select " + "uid" + " from " + "offline" + " where " + "account" + " = '" + paramString + "'" + " )";
    Cursor localCursor = paramContext.getContentResolver().query(m.k, null, str1, null, " seq ASC");
    Object localObject;
    if ((localCursor == null) || (!localCursor.moveToFirst()))
    {
      if (localCursor != null)
        localCursor.close();
      localObject = new LinkedList();
      return localObject;
    }
    LinkedList localLinkedList = new LinkedList();
    int n = 0;
    label179: String str2 = localCursor.getString(localCursor.getColumnIndex("content"));
    if (str2 == null);
    while (true)
    {
      if (localCursor.moveToNext())
        break label179;
      localCursor.close();
      if (com.netease.pris.app.e.e)
        b.e("ManagerSubcribe", "loadAllSubscribe size is: " + n + " time is:" + (System.currentTimeMillis() - l1));
      localObject = localLinkedList;
      break;
      try
      {
        new h(new a(new k(localLinkedList))).a(com.netease.pris.a.e.a(str2));
        n++;
      }
      catch (Exception localException)
      {
        while (true)
          localException.printStackTrace();
      }
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.c.c
 * JD-Core Version:    0.6.0
 */